Skip to content
This repository has been archived by the owner on Mar 10, 2020. It is now read-only.

Fix the ping results #556

Closed
wants to merge 1 commit into from
Closed

Conversation

ngotchac
Copy link

I've see cases where the ping response is in fact on 2 lines, the second one containing the Success (false), the Time and the Text. This happens for example if you try to ping your self.

@daviddias
Copy link
Contributor

@Kubuxu any thoughts on why this happens?

@daviddias daviddias requested a review from Kubuxu July 8, 2017 09:10
@daviddias
Copy link
Contributor

@ngotchac mind rebasing master onto this PR?

@Kubuxu thoughts?

@Kubuxu
Copy link

Kubuxu commented Jul 8, 2017

It has happened because ping endpoint is ndjson streaming endpoing. The order of responses that can be received there are not part of the API.

What the code should do is parse the response as NDJSON (line by line) and look for .Time != 0.

@daviddias
Copy link
Contributor

@ngotchac wanna follow up on this PR?

Copy link

@Kubuxu Kubuxu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't the right way to do it as API does not specify order of messages. See #556 (comment)

(cleaning up my CR queue)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants